<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<%@ include file="/web/header.jsp"%>
</head>
<body>
<fieldset class="layui-elem-field" style="margin: 10px">
			<legend></legend>
			<div class="layui-field-box">
				<form class="layui-form layui-form-pane" action="">
					<div class="layui-form-item">
						<label class="layui-form-label">&nbsp&nbsp项目编号</label>
						<div class="layui-input-inline">
							<input type="text" name="code" required lay-verify="required"
								placeholder="请输入项目编号" autocomplete="off" class="layui-input">							 
						</div>						
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">&nbsp&nbsp项目名</label>
						<div class="layui-input-inline">
							<input type="text" name="name" required lay-verify="required"
								placeholder="请输入项目名" autocomplete="off" class="layui-input">
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">时间</label>
						<div class="layui-input-inline">
						<input type="text" class="layui-input" id="test1" name="time" placeholder="项目时间">
						</div>
					</div>
					<div class="layui-form-item">
						<div class="layui-input-block">
							<input type="button" value="添加" class="layui-btn" lay-submit
								lay-filter="add"> 
							<input type="reset" value="重置"class="layui-btn layui-btn-primary">
							<input type="button" value="关闭"class="layui-btn" onclick="layerClose()">	
						</div>
						
					</div>
					<input type="hidden" name="action" value="add">
				</form>
			</div>
</fieldset>
<script type="text/javascript">
		formSubmit("add","/ProjectServlet","text",function(data){
			if(data==1){
		 		layer.msg("添加成功",layerClose); 
		    }else if(data=="repeat"){
		 		layer.msg("添加失败，项目已添加重复");
	        }else{
		 		layer.msg("添加失败"); 
	 		}
		})
		
layui.use('laydate', function(){
  var laydate = layui.laydate;
  
  //执行一个laydate实例
  laydate.render({
    elem: '#test1' //指定元素
  });
});
</script>
</body>
</html>